#!/bin/sh

SOFT_DIR=/opt/soft/flannel
FLANNEL_VERSION=v0.14.0
ARCHIVE_NAME=flannel-${FLANNEL_VERSION}-linux-amd64.tar.gz

if [ ! -d $SOFT_DIR ]; then
    echo "Creating directory ${SOFT_DIR}"
    mkdir -p $SOFT_DIR;
fi

wget https://github.com/coreos/flannel/releases/download/${FLANNEL_VERSION}/${ARCHIVE_NAME}
tar -xzvf ${ARCHIVE_NAME} -C ${SOFT_DIR}

cd ${SOFT_DIR}